<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            width: 100px;
            height: 100px;
        }
    </style>
</head>
<body>
    <img class="time" src="../images/2.png" alt="">
    <img class="time" src="../images/2.png" alt="">
    <img src="../images/mao.png" alt="">
    <img class="time" src="../images/2.png" alt="">
    <img class="time" src="../images/2.png" alt="">
    <img src="../images/mao.png" alt="">
    <img class="time" src="../images/2.png" alt="">
    <img class="time" src="../images/2.png" alt="">
    <script>
        let aImg = document.getElementsByClassName('time');

        setInterval(function(){
            let myTime = new Date();
            let hours = (myTime.getHours()+'').padStart(2,"0");
            let min = (myTime.getMinutes()+'').padStart(2,"0");
            let sec = (myTime.getSeconds()+'').padStart(2,"0");
            let str = `${hours}${min}${sec}`;
            for(let i = 0;i < str.length;i++){
                aImg[i].src = `../images/${str.charAt(i)}.png`;
            }
        },1000)
    </script>
</body>
</html>